package com.mj.whois.service;

import com.mj.whois.util.HttpUtils;

/**
 * Whois查询 
 * @author zhaominglei
 * @date 2015-3-19
 * 
 */
public class WhoisService extends BaseService {
	@SuppressWarnings("unused")
	private static final String TAG = WhoisService.class.getSimpleName();
	private static final String ALEXA_WHOIS_URL = "http://whois.alexa.cn/whois.php"; //Alexa
	
	public String getWhoisInfo(String domainname) {
		domainname = domainname.replaceAll("http://", "").replaceAll("www.", "").replaceAll("www", "");
		if (domainname == null || domainname.equals("")) {
			return null;
		}
		StringBuilder queryURL = new StringBuilder(ALEXA_WHOIS_URL);
		queryURL.append("?u=").append(domainname);
		String html = HttpUtils.doGetForAlexa(domainname, queryURL.toString(), null);
		return html;
	}
}
